<!DOCTYPE html>
<html>

<head>
    <title>Preview Symbol</title>
    <meta charset="UTF-8">
    <!--<link rel="shortcut icon" href="custom/images/favicon.ico?v=2" />-->
    <style>
        html,
        body {
            padding: 0px;
            margin: 0px;
        }
    </style>
    <!--<script src='custom/configs/htconfig.js'></script>-->
    <script src="libs/ht.js"></script>
    <script src='libs/ht-vector.js'></script>
    <!-- <script src="./ajaxQuery/ajaxURL.js"></script> -->
    <!--<script src='libs/ht-vector.js'></script>-->
    <script>
        function init() {
            const queryURl = 'http://localhost:7888/layout_2Deditor';
            dataModel = new ht.DataModel();
            graphView = new ht.graph.GraphView(dataModel);
            graphView.addToDOM();
            graphView.setEditable(true);
            dataModel.a('queryURl', queryURl);
            let deptCode = window.parent.graphView.dm().a('workshopCode');
            ht.Default.xhrLoad(GetQueryString('tag'), function (text) {
                var json = ht.Default.parse(text);
                // if (json.title) document.title = json.title;
                // dataModel.setBackground(json.background);
                node = new ht.Node();
                node.setImage(json);
                // node.a('preUrl', queryURl + '/index.html?code=' + code + '-' + node.a('status'));//跳转地址
                node.setPosition(graphView.getWidth() / 2, graphView.getHeight() / 2);
                dataModel.add(node);
            });
        }

        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return decodeURI(r[2]);
            return null;
        }
    </script>
</head>

<body onload='setTimeout(init, 300)'>
</body>

</html>